package com.person.jiaiplan.assembler;

import com.person.jiaiplan.pojo.dto.calendar.CommemorationDayResDTO;
import com.person.jiaiplan.pojo.dto.calendar.EveryDayWriteQueryDTO;
import com.person.jiaiplan.pojo.entity.CommemorationDayConfig;
import com.person.jiaiplan.pojo.entity.EverydayWriteLog;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface CalendarAssembler {

    CalendarAssembler INSTANCE = Mappers.getMapper(CalendarAssembler.class);


    /**
     * 转换对象
     *
     * @param config
     * @return
     */
    @Mapping(source = "time", target = "time", dateFormat = "yyyy-MM-dd")
    CommemorationDayResDTO toCommemorationDayResDTO(CommemorationDayConfig config);

    EveryDayWriteQueryDTO toEveryDayWriteQueryDTO(EverydayWriteLog everydayWriteLog);
}
